//
//  NavigationBar.swift
//  WuZhen
//
//  Created by 今安在 on 2024/3/25.
//

import SwiftUI

struct NavigationBar: View {

    @State var showSheet :Bool = false
    
    
    var body: some View {
        
        ZStack{
            Rectangle()
                .frame(maxWidth: .infinity)
                .frame(height: 100)
                .background(.ultraThinMaterial)
                .ignoresSafeArea()
                .frame(maxHeight: .infinity, alignment: .top)
                .blur(radius: 10)
                .opacity(1)
                .blur(radius:10)
                .opacity(1)
            
            HStack(spacing : 16){
                
                Button(action: {
                    showSheet.toggle()
                }, label: {
                    Image(systemName: "doc.text.magnifyingglass")
                        .font(.system(size: 17, weight: .bold))
                        .frame(width: 36, height: 36)
                        .foregroundColor(.secondary)
                        .background(.ultraThinMaterial)
                })
                .sheet(isPresented: $showSheet, content: {
                    SearchView()
                })
            }
            
        }
        
    }
}

#Preview {
    NavigationBar()
}
